package com.masterclient.app.modules.firstpager.fragments.adapters;

import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.masterclient.app.R;
import com.eoner.baselibrary.bean.firstpager.BrandsRecommendBean;
import com.eoner.baselibrary.utils.GlideUtil;
import com.eoner.baselibrary.utils.ScreenUtils;

import java.util.List;

/**
 * 作者：sean
 * 创建时间：2017/6/14 15:19
 * 功能说明：首页品牌adaper
 */

public class BrandRecyclerAdapter extends BaseQuickAdapter<BrandsRecommendBean.DataBean.ShBrandListBean.ShItemsBean, BaseViewHolder> {
    public BrandRecyclerAdapter() {
        super(R.layout.view_brand_item);
    }

    @Override
    protected void convert(BaseViewHolder helper, BrandsRecommendBean.DataBean.ShBrandListBean.ShItemsBean item) {
        helper.setText(R.id.tv_location,item.getSh_city_name());
        helper.setText(R.id.tv_shop_name,item.getSh_name());
//        helper.setText(R.id.tv_shop_found_time,item.get);

        if("1".equals(item.getSh_is_new())){//最新
            helper.getView(R.id.iv_new_brand_tag).setVisibility(View.VISIBLE);
        }else {
            helper.getView(R.id.iv_new_brand_tag).setVisibility(View.GONE);
        }
        GlideUtil.displayImage(mContext,item.getSh_image(),(ImageView) helper.getView(R.id.iv_goods));
        GlideUtil.displayCircleImage(mContext,item.getSh_logo(),(ImageView) helper.getView(R.id.ci_shop_logo),
                R.mipmap.user_head_default_icon,ScreenUtils.dp2px(60),ScreenUtils.dp2px(60));
//        App.picasso.load(item.getSh_logo()).resize(ScreenUtils.dp2px(60),ScreenUtils.dp2px(60)).transform(new CircleBorderTransform(dp2px(1),R.color.bg_gray)).into((ImageView) helper.getView(R.id.ci_shop_logo));
//        App.picasso.load(item.getSh_image()).fit().into((ImageView) helper.getView(R.id.iv_goods));
//        helper.setText(R.id.tv_brand_discrible, item.getSh_introduce());
        List<BrandsRecommendBean.DataBean.ShBrandListBean.ShItemsBean.ShProductsBean> products = item.getSh_products();

    }

}
